package Pro;

import Adapter.Adapter;
import Adapter.InewJuicer;

public class ClientClass02 {
    public static void main(String[] args) throws CloneNotSupportedException {
        MyFruit fruit1 = new Apple();
        MyFruit fruit2 = new Banana();
        MyFruitStore02 mfs = MyFruitStore02.getfruitstore();
        mfs.Add(1,fruit1);
        mfs.Add(2,fruit2);
        mfs.Add(3,new Apple());
        mfs.Add(4,new Banana());
        //果汁机
        MyFruitStore02 mfs2 = MyFruitStore02.getfruitstore();
        InewJuicer newJuicer = new Adapter();
        System.out.println(newJuicer.newPort(mfs2.Get(3),mfs2.Get(4)));
//        MyFruit fruit = mfs.Get(4); //克隆得到
//        fruit.display();
//        System.out.println("mfs: " + mfs.toString());
    }
}
